require.config({
               baseUrl:"../",
               paths:{
               bsl:'bsl',
               
               }
               });
require(['bsl'],function(bsl){
        document.addEventListener('deviceready', onDeviceready, false);
        function onDeviceready(){
        alert ('start');
        function openView(animation){
        // var url = 'http://m.baidu.com/?from=2001a';
        var url = 'Module.bundle/www/com.foss.cordova/demoHtml/webViewDemo2.html';
        var view = bsl.webview.create(url,"webView1",{
                                      background:"rgba( 165,42,  42,0.4)",
                                      // background:"rgb( 165,42,  42)",
                                      // background:"#A52A2A",
                                      // top:"20",
                                      // bottom:"90%",
                                      // left:"80",
                                      right:"100%",
                                      // width:"300",
                                      height:"100%",
                                      // bounce:true,
                                      bounceBackground:"url(www/img/logo.png)",
                                      margin:"",
                                      // mask:"rgba(0,0,0,0.5)",
                                      opacity:"0",
                                      popGesture:"close",
                                      scalable:true,
                                      scrollIndicator:"horizontal",
                                      softinputMode:"adjustResize",
                                      zindex:"99",
                                      });
        view.addEventListener("error",function(){console.log('addEventListener: error')},false);
        view.addEventListener("loaded",function(){console.log('addEventListener: loaded')},false);
        view.addEventListener("loading",function(){console.log('addEventListener: loading')},false);
        view.addEventListener("close",function(){console.log('addEventListener: close')},false);
        
        bsl.webview.show(view,animation,400,function(){
                         console.log("did show 666666666666666666666");
                         });
        };
        
        var rightBtn = document.getElementById("button1");
        rightBtn.onclick = function (){
        var storage = window.localStorage;
        storage.setItem("ani", "slide-in-right");
        openView("slide-in-right");
        };
        
        var leftBtn = document.getElementById("button2");
        leftBtn.onclick = function(){
        var storage = window.localStorage;
        storage.setItem("ani", "slide-in-left");
        openView("slide-in-left");
        };
        
        var topBtn = document.getElementById("button3");
        topBtn.onclick = function(){
        var storage = window.localStorage;
        storage.setItem("ani", "slide-in-top");
        openView("slide-in-top");
        };
        
        var bottomBtn = document.getElementById("button4");
        bottomBtn.onclick = function(){
        var storage = window.localStorage;
        storage.setItem("ani", "slide-in-bottom");
        openView("slide-in-bottom");
        };
        
        var zoomBtn = document.getElementById("button5");
        zoomBtn.onclick = function(){
        var storage = window.localStorage;
        storage.setItem("ani", "zoom-out");
        openView("zoom-out");
        };
        
        var zoomFadeBtn = document.getElementById("button6");
        zoomFadeBtn.onclick = function(){
        var storage = window.localStorage;
        storage.setItem("ani", "zoom-fade-out");
        openView("zoom-fade-out");
        };
        
        var fadeBtn = document.getElementById("button7");
        fadeBtn.onclick = function(){
        var storage = window.localStorage;
        storage.setItem("ani", "fade-in");
        openView("fade-in");
        };
        
        var noneBtn = document.getElementById("button8");
        noneBtn.onclick = function(){
        var storage = window.localStorage;
        storage.setItem("ani", "none");
        openView("none");
        };
        
        }
});